const http = require("../utils/request.js") //引入封装好的js文件

module.exports = {
  queryShop(page, shopType) {
    let data = Object.assign(page);
    data.shopType = shopType;
    return http.post('/appShop/search', data)
  },
  queryShopById(id) {
    return http.get('/appShop/detail/' + id, {});
  },
  queryShopOrderList(id) {
    return http.get('/appOrder/queryShopOrder/' + id, {});
  },
  createOrder(startTime,endTime, remark, shopId) {
    let data = {};
    data.shopId = shopId;
    data.userId = getApp().globalData.userInfo.id;
    data.orderUseTime = startTime + ' - '+ endTime;
    data.orderRemark = remark;

    return http.post('/appOrder/create', data);
  }
}